package it.clem.little.domain.units;

public class UnitFactory {
  public static IUnit getFootman() {
    return new Footman();
  }

  public static IUnit getTroll() {
    return new Troll();
  }

  public static IUnit getArcher() {
    return new Archer();
  }

  public static IUnit getNinja() {
    return new Ninja();
  }

  public static IUnit getKnight() {
    return new Knight();
  }

  public static IUnit getPriest() {
    return new Priest();
  }

  public static IUnit getShaman() {
    return new Shaman();
  }

  public static IUnit getMage() {
    return new Mage();
  }

  public static IUnit getWolfRider() {
    return new WolfRider();
  }

  public static IUnit getIronWheel() {
    return new IronWheel();
  }

  public static IUnit getArchangel() {
    return new Archangel();
  }

  public static IUnit getTrollCyborg() {
    return new TrollCyborg();
  }

  public final static IUnit[] ELENCO_UNITA = new IUnit[] { getFootman(), getTroll(), getArcher(), getNinja(), getKnight(), getPriest(), getShaman(), getMage(),
      getWolfRider(), getIronWheel(), getArchangel(), getTrollCyborg() };

  public static StringBuilder showData() {
    StringBuilder sb = new StringBuilder();
    for (IUnit unit : ELENCO_UNITA) {
      sb.append(String.format("%11s %10s Armor:%2d %10s Attack:%2d HP:%4d Range:%d Gold:%4d Cri:%4d Pop:%d Size:%s\n", unit.getName(), unit.getArmorType(),
          unit.getArmorPoints(), unit.getAttackType(), unit.getAttackPoints(), unit.getInitialHP(), unit.getRange(), unit.getBuildCost().gold,
          unit.getBuildCost().cristals, unit.getPopulation(), unit.getSize()));

    }
    return sb;
  }

  public static void main(String... s) {
    System.out.println(showData());
  }
}
